SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

CREATE TABLE IF NOT EXISTS `__PREFIX__tpmecms_cate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('channel','page','link','list') DEFAULT NULL COMMENT '类型',
  `model_id` int(10) unsigned DEFAULT '0' COMMENT '模型ID',
  `parent_id` int(10) unsigned DEFAULT '0' COMMENT '父ID',
  `name` varchar(30) DEFAULT '' COMMENT '栏目名称',
  `image` varchar(100) DEFAULT '' COMMENT '图片',
  `flag` varchar(100) DEFAULT '' COMMENT '标志',
  `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  `description` varchar(255) DEFAULT '' COMMENT '描述',
  `outlink` varchar(255) DEFAULT '' COMMENT '链接',
  `items` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '文章数量',
  `weigh` int(10) DEFAULT NULL,
  `tpl` varchar(100) DEFAULT '' COMMENT '栏目页模板',
  `listtpl` varchar(100) DEFAULT '' COMMENT '列表页模板',
  `showtpl` varchar(100) DEFAULT '' COMMENT '详情页模板',
  `pagesize` smallint(5) NOT NULL DEFAULT '10' COMMENT '分页大小',
  `isnav_switch` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否导航显示',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  `status` enum('1','2') DEFAULT '1' COMMENT '状态:1=正常,2=隐藏',
  `diyname` varchar(100) DEFAULT NULL COMMENT '自定义名称',
  `table_name` varchar(255) DEFAULT NULL COMMENT '数据库表名',
  PRIMARY KEY (`id`),
  KEY `weigh` (`weigh`,`id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='栏目管理';


-- ----------------------------
-- Records of __PREFIX__tpmecms_cate
-- ----------------------------
BEGIN;
INSERT INTO `__PREFIX__tpmecms_cate` VALUES (1, 'page', 0, 0, 'TpMeCms介绍', '/cms/images/about-1.jpg', '', '', '', 'TpMeCMS是一款基于FastAdmin框架开发的，FastAdmin基于ThinkPHP5+Bootstrap开发的框架,核心代码简洁、明了，适用于微信小程序/公众号，PC网站，手机网站，App（Api接口）等集于一体的Tp框架，后台直接生成数据库的增删改查，方便二次开开发，了解thinkphp5即可上手   ', '', 0, 60, '', 'about', 'about', 1, 1, 1624065594, 1624921664, '1', 'about', '__PREFIX__tpmecms_page');
INSERT INTO `__PREFIX__tpmecms_cate` VALUES (2, 'list', 0, 0, '信息动态', '', '', '', '', '', '', 0, 28, '', 'news', 'show', 2, 1, 1624068742, 1626656034, '1', 'news', '__PREFIX__tpmecms_news');
COMMIT;





CREATE TABLE IF NOT EXISTS `__PREFIX__tpmecms_page` (
  `id` int(8) unsigned NOT NULL AUTO_INCREMENT,
  `cate_id` tinyint(10) unsigned NOT NULL DEFAULT '0' COMMENT '栏目',
  `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
  `content` text NOT NULL COMMENT '内容',
  `description` varchar(255) DEFAULT NULL COMMENT '简介',
  `createtime` int(11) DEFAULT NULL,
  `updatetime` int(11) unsigned DEFAULT '0' COMMENT '更新时间',
  `weigh` int(10) DEFAULT '50',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='单页管理';

-- ----------------------------
-- Records of __PREFIX__tpmecms_page
-- ----------------------------
BEGIN;
INSERT INTO `__PREFIX__tpmecms_page` VALUES (1, 52, '简单介绍', '<div style=\"line-height: 1.4;\"><div style=\"line-height: 1.4;\"><span style=\"font-size: 18px;\">TpMeCMS是一款基于FastAdmin框架开发的，FastAdmin基于ThinkPHP5+Bootstrap开发的框架,核心代码简洁、明了，适用于微信小程序/公众号，PC网站，手机网站，App（Api接口）等集于一体的Tp框架，后台直接生成数据库的增删改查，方便二次开开发，了解thinkphp5即可上手</span></div><br><br><div style=\"line-height: 1.4;\"><span style=\"font-size: 18px;\">## TpMeCMS由来</span></div><div style=\"line-height: 1.4;\"><span style=\"font-size: 18px;\">    用过FastAdmin的插件cms，SIYUCMS，行云海CMS等，功能功能各有优点缺点，发现自己的项目经常使用（微信小程序/公众号，PC网站，手机网站，App（Api接口）等），结合还需要二次开发，才能使用，于是就使用自己熟悉等thinkphp5，FastAdmin来开发自己的cms框架</span></div><br><div style=\"line-height: 1.4;\"><span style=\"font-size: 18px;\">## TpMeCMS主要优点</span></div><div style=\"line-height: 1.4;\"><span style=\"font-size: 18px;\">    集成微信小程序和微信公众号功能，后台集成栏目管理等，接口可以直接拷贝app\\cms\\controller\\Cms</span></div></div>\r\n', '', 1580966471, 1624921164, 11);
COMMIT;



-- ----------------------------
-- Table structure for __PREFIX__tpmecms_news
-- ----------------------------
-- DROP TABLE IF EXISTS `__PREFIX__tpmecms_news`;
CREATE TABLE IF NOT EXISTS `__PREFIX__tpmecms_news` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT '' COMMENT '文章标题',
  `image` varchar(255) DEFAULT '' COMMENT '缩略图',
  `images` varchar(1500) DEFAULT '' COMMENT '组图',
  `seotitle` varchar(255) DEFAULT '' COMMENT 'SEO标题',
  `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
  `description` varchar(255) DEFAULT '' COMMENT '描述',
  `tags` varchar(255) DEFAULT '' COMMENT 'TAG',
  `weigh` int(10) DEFAULT NULL,
  `views` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '浏览次数',
  `createtime` int(10) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  `publishtime` int(10) DEFAULT NULL COMMENT '发布时间',
  `deletetime` int(10) DEFAULT NULL COMMENT '删除时间',
  `memo` varchar(100) DEFAULT '' COMMENT '备注',
  `content` text COMMENT '内容',
  `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '状态:1=正常,2=隐藏',
  PRIMARY KEY (`id`),
  KEY `status` (`status`),
  KEY `channel` (`weigh`,`id`),
  KEY `weigh` (`weigh`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='信息动态';

-- ----------------------------
-- Records of __PREFIX__tpmecms_news
-- ----------------------------
BEGIN;
INSERT INTO `__PREFIX__tpmecms_news` VALUES (1, 'TpMeCMS后台添加和编辑页面的文件下拉等输入框代码替换', '/cms/images/s01.jpg', '/cms/images/s01.jpg', '', '', 'TpMeCMS', 'admin,view,后台html,上传视频,上传多图', 0, 29, NULL, 1626750254, NULL, NULL, '', '<p><b>1</b></p>', '1');
INSERT INTO `__PREFIX__tpmecms_news` VALUES (2, 'TpMeCMS介绍及下载地址', '/cms/images/news-1.jpg', '/cms/images/news-1.jpg', '', '', '', '标签,分割', 111, 51, 1624004284, 1627722058, 1624004236, NULL, '', '<p>TpMeCMS开源地址Gitee：&nbsp;&nbsp;<a href=\"https://gitee.com/xiaohe4966/tp-me-cms\" target=\"_blank\">https://gitee.com/xiaohe4966/tp-me-cms</a></p><p>完整静态打包地址Github：&nbsp;<a href=\"https://github.com/xiaohe4966/TpMeCMS\">https://github.com/xiaohe4966/TpMeCMS</a><a href=\"https://github.com/xiaohe4966/TpMeCMS\"></a></p><p><br></p><p>完整示例网站：<a href=\"http://yunshang.he4966.cn/cms/index/index\" target=\"_blank\">http://yunshang.he4966.cn/cms/index/index</a>  <script src=\'https://gitee.com/xiaohe4966/tp-me-cms/widget_preview\' async defer></script>\n<div id=\"osc-gitee-widget-tag\"></div>\n<style>\n.osc_pro_color {color: #4183c4 !important;}\n.osc_panel_color {background-color: #ffffff !important;}\n.osc_background_color {background-color: #ffffff !important;}\n.osc_border_color {border-color: #0671b8 !important;}\n.osc_desc_color {color: #666666 !important;}\n.osc_link_color * {color: #5c095c !important;}\n</style></p>', '1');
INSERT INTO `__PREFIX__tpmecms_news` VALUES (3, '员工列表', '/cms/images/news-2.jpg', '/cms/images/services-1.jpg', 'International standard laboratory', '公共服务平台关键字', '/cms/images/services-1.jpg', '', 112, 21, 1624263266, 1624934496, 1624263230, 1624934496, '', '<p>zheshi miaos&nbsp;</p>', '1');
INSERT INTO `__PREFIX__tpmecms_news` VALUES (4, 'Fastadmin 后台表格每行数据加按钮弹新页面教程及更具条件显示或隐藏', '', '', '', '', '', '', 113, 17, 1626143944, 1627636259, 1626143865, NULL, '', '<p>在对应的js里面编辑</p><p><br></p><p>找到如下代码：</p><pre><code class=\"lang-js\">    {field: \'operate\', title: __(\'Operate\'), table: table,<br></code></pre><p>并在后面添加：可自行修改</p><pre><code class=\"lang-js\">                        {field: \'operate\', title: __(\'Operate\'), table: table,\r\n                            buttons: [\r\n                                {\r\n                                    name: \'editprice\',\r\n                                    text: \'编辑附近大学\',\r\n                                    title: \'编辑附近大学\',\r\n                                    classname: \'btn btn-xs btn-success btn-dialog\',\r\n                                    icon: \'fa fa-folder-o\',\r\n                                    url: \'shop/yuyue_order2/editprice\'\r\n                                }\r\n                            ], \r\n                            events: Table.api.events.operate, formatter: Table.api.formatter.operate}<br></code></pre><p><br></p><p><br></p><p><br></p><p>如果要更具条件来显示或隐藏该按钮在里面加入</p><pre><code class=\"lang-js\">   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hidden:function(row){\r\n                                            if(row.xiaohe==0){//xiaohe就是这个数据的字段 自行修改\r\n                                                return false; //显示该按钮\r\n                                            }else{\r\n                                                return true;&nbsp;&nbsp;//隐藏该按钮\r\n                                            }\r\n                                        },<br></code></pre><p>示例用法</p><pre><code>       {field: \'operate\', title: __(\'Operate\'), table: table,\r\n                            buttons: [\r\n                                {\r\n                                    name: \'editprice\',\r\n                                    text: \'编辑附近大学\',\r\n                                    title: \'编辑附近大学\',\r\n                                    classname: \'btn btn-xs btn-success btn-dialog\',\r\n                                    icon: \'fa fa-folder-o\',\r\n\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//隐藏按钮条件\r\n   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hidden:function(row){\r\n                                            if(row.end_status==0){  // 自行修改条件\r\n                                                return false; //显示该按钮\r\n                                            }else{\r\n                                                return true;  //隐藏该按钮\r\n                                            }\r\n                                    },\r\n\r\n                                    url: \'shop/yuyue_order2/editprice\'\r\n                                }\r\n                            ], \r\n                            events: Table.api.events.operate, formatter: Table.api.formatter.operate}<br></code></pre>', '1');
INSERT INTO `__PREFIX__tpmecms_news` VALUES (5, '宝塔定时任务执行每30秒执行一次', '', '', '', '', '', '', 114, 10, 1626857801, 1626857801, 1626857661, NULL, '', '<p>更改前</p><pre><code class=\"lang-bash\">#!/bin/bash\r\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\r\nexport PATH\r\ncurl -sS --connect-timeout 10 -m 3600 \'http://newk3.he4966.cn/api/twhttp/update_data\'\r\necho \"----------------------------------------------------------------------------\"\r\nendDate=`date +\"%Y-%m-%d %H:%M:%S\"`\r\necho \"★[$endDate] Successful\"\r\necho \"----------------------------------------------------------------------------\"\r\n<br></code></pre><p><br></p><p><br></p><p><br></p><p>更改后</p><pre><code class=\"lang-bash\">#!/bin/bash\r\nPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin\r\nexport PATH\r\nstep=30 //时间\r\nfor (( i = 0; i &lt; 60; i=(i+step) )); do\r\ncurl -sS --connect-timeout 10 -m 3600 \'http://newk3.he4966.cn/api/twhttp/update_data\'\r\necho \"----------------------------------------------------------------------------\"\r\nendDate=`date +\"%Y-%m-%d %H:%M:%S\"`\r\necho \"★[$endDate] Successful\"\r\necho \"----------------------------------------------------------------------------\"\r\nsleep $step\r\ndone\r\nexit 0\r\n<br></code></pre>', '1');
COMMIT;